﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using XiaoweiUWP.Models;

//https://go.microsoft.com/fwlink/?LinkId=234236 上介绍了“用户控件”项模板

namespace XiaoweiUWP.HpControls
{
    public sealed partial class SkillItem : UserControl
    {
        public SkillItem()
        {
            this.InitializeComponent();
        }
        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(SkillItem), new PropertyMetadata(0));

        private void Grid_PointerPressed(object sender, PointerRoutedEventArgs e)
        {

           EventManager.Trigger("test", this);

        }
        public void  TurnUp()
        {
            this.RotateAngle(-90);
        }
        public void TurnDown()
        {
            this.RotateAngle(90);
        }
        public void TurnNormal()
        {
            this.RotateAngle(0);
        }
        private void RotateAngle(int angle)
        {
            RotateTransform rotate = new RotateTransform();
            rotate.Angle = angle;
            rotate.CenterX = popuparrow.ActualWidth / 2;
            rotate.CenterY = popuparrow.ActualWidth / 2;
            popuparrow.RenderTransform = rotate;
        }

    }
}
